"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WechatSdkManager = void 0;
const HttpUtil_1 = require("../src/engine/utils/HttpUtil");
const APP_ID = "wxa16c47ab675b6edb";
const AppSecret = "c34de2f3a114c67ae3fbfc178f7f61cc";
// com.g1ame.dajialejingji
// const APP_ID: string = "wx2b30957daca6d855"
// const AppSecret: string = "5dc1046cb482a7676ce9c6ecc802c364"
class WechatSdkManager {
    get_access_token(code, callback = null) {
        let data = {
            "appid": APP_ID,
            "secret": AppSecret,
            "code": code,
            grant_type: "authorization_code"
        };
        HttpUtil_1.HttpUtil.request_by_form("https://api.weixin.qq.com/sns/oauth2/access_token", data, callback);
    }
    get_userinfo(access_token, openid, callback = null) {
        let data = {
            access_token: access_token,
            openid: openid
        };
        HttpUtil_1.HttpUtil.request_by_form("https://api.weixin.qq.com/sns/userinfo", data, callback);
    }
}
exports.WechatSdkManager = WechatSdkManager;
WechatSdkManager.instance = new WechatSdkManager();
